package com.example.managemyself.model;

import androidx.room.Entity;
import androidx.room.PrimaryKey;

/**
 * 用户设置数据模型
 */
@Entity(tableName = "user_settings")
public class UserSettings {
    @PrimaryKey
    private int userId;
    
    // 基础设置
    private String theme;              // 主题设置
    private boolean notificationsEnabled; // 是否启用通知
    private int pomodoroWorkDuration;  // 番茄钟工作时长（分钟）
    private int pomodoroBreakDuration; // 番茄钟休息时长（分钟）
    private String language;           // 语言设置
    
    // 数据管理设置
    private boolean dataSync;          // 是否同步数据
    private String syncFrequency;      // 同步频率
    private String dataRetention;      // 数据保留时间
    
    // 隐私设置
    private boolean biometricEnabled;  // 是否启用生物识别
    private String autoLockTime;       // 自动锁定时间
    
    // API密钥管理
    private String weatherApiKey;      // 天气API密钥
    private String aiApiKey;           // AI助手API密钥
    private String almanacApiKey;      // 黄历API密钥
    
    public UserSettings(int userId) {
        this.userId = userId;
        // 基础设置默认值
        this.theme = "light";
        this.notificationsEnabled = true;
        this.pomodoroWorkDuration = 25;
        this.pomodoroBreakDuration = 5;
        this.language = "zh_CN";
        
        // 数据管理默认值
        this.dataSync = false;
        this.syncFrequency = "daily";
        this.dataRetention = "1year";
        
        // 隐私设置默认值
        this.biometricEnabled = false;
        this.autoLockTime = "5min";
        
        // API密钥默认为空
        this.weatherApiKey = "";
        this.aiApiKey = "";
        this.almanacApiKey = "";
    }
    
    // Getters and Setters
    public int getUserId() {
        return userId;
    }
    
    public void setUserId(int userId) {
        this.userId = userId;
    }
    
    public String getTheme() {
        return theme;
    }
    
    public void setTheme(String theme) {
        this.theme = theme;
    }
    
    public boolean isNotificationsEnabled() {
        return notificationsEnabled;
    }
    
    public void setNotificationsEnabled(boolean notificationsEnabled) {
        this.notificationsEnabled = notificationsEnabled;
    }
    
    public int getPomodoroWorkDuration() {
        return pomodoroWorkDuration;
    }
    
    public void setPomodoroWorkDuration(int pomodoroWorkDuration) {
        this.pomodoroWorkDuration = pomodoroWorkDuration;
    }
    
    public int getPomodoroBreakDuration() {
        return pomodoroBreakDuration;
    }
    
    public void setPomodoroBreakDuration(int pomodoroBreakDuration) {
        this.pomodoroBreakDuration = pomodoroBreakDuration;
    }
    
    public String getLanguage() {
        return language;
    }
    
    public void setLanguage(String language) {
        this.language = language;
    }
    
    public boolean isDataSync() {
        return dataSync;
    }
    
    public void setDataSync(boolean dataSync) {
        this.dataSync = dataSync;
    }
    
    public String getSyncFrequency() {
        return syncFrequency;
    }
    
    public void setSyncFrequency(String syncFrequency) {
        this.syncFrequency = syncFrequency;
    }
    
    public String getDataRetention() {
        return dataRetention;
    }
    
    public void setDataRetention(String dataRetention) {
        this.dataRetention = dataRetention;
    }
    
    public boolean isBiometricEnabled() {
        return biometricEnabled;
    }
    
    public void setBiometricEnabled(boolean biometricEnabled) {
        this.biometricEnabled = biometricEnabled;
    }
    
    public String getAutoLockTime() {
        return autoLockTime;
    }
    
    public void setAutoLockTime(String autoLockTime) {
        this.autoLockTime = autoLockTime;
    }
    
    public String getWeatherApiKey() {
        return weatherApiKey;
    }
    
    public void setWeatherApiKey(String weatherApiKey) {
        this.weatherApiKey = weatherApiKey;
    }
    
    public String getAiApiKey() {
        return aiApiKey;
    }
    
    public void setAiApiKey(String aiApiKey) {
        this.aiApiKey = aiApiKey;
    }
    
    public String getAlmanacApiKey() {
        return almanacApiKey;
    }
    
    public void setAlmanacApiKey(String almanacApiKey) {
        this.almanacApiKey = almanacApiKey;
    }
} 